<?php
include( "agent/onlinebet_header.php" );
if ($curruser['acl'] != 255)
{
    $userlist = GetUserList($curruser['id']);
    if ($userlist == "")
    {
        $ui->showErrorPage("<p>还没有建立会员！</p>");
        exit();
    }
}
$g_disk_code = array(1 => "a", 2 => "b", 3 => "c", 4 => "d");
$disk_code = "a";
$diskStr = "";
if (0 < $disk)
{
    $disk_code = $g_disk_code[$disk];
    $diskStr = $disk_code;
}
include( "class_6h/BetTotal_6h.php" );
$BetTotal_6h = new BetTotal_6h($lotto_id);
$betids = array(0, 1, 2, 3, 13, 14, 18, 20, 28, 30, 47,49,50);
$colors = array("", "red", "blue", "green");
$dataTotalArr = array();
$showDataArr = array();
switch ($bets)
{
    case 0 :
        $bettypeStr = "1001,1,2,3,13,14,18,20,28,30,47,49,50";
        $listbetmod = 99;
        $betsGame = "1001";
        break;
    case 1 :
        $bettypeStr = "0,1,2,3,13,14,18,20,28,30,47,49,50";
        $listbetmod = 0;
        $betsGame = "0";
        break;
    case 2 :
        $bettypeStr = "1,2,3,13,14,18,20,24,28,30,47,49,50";
        $listbetmod = 24;
        $betsGame = "24";
        break;
    default :
        $bettypeStr = "1001,1,2,3,13,14,18,20,28,30,47,49,50";
        $listbetmod = 99;
        $betsGame = "1001";
        break;
}
$theacl = $curruser['acl'];
$userid = $curruser['id'];
$showid = $theacl == 255 ? "0" : $userid;
$dataTotalArr[$betsGame] = array(
    "bettype" => $betsGame,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "back1" => 0,
    "back2" => 0
);
$dataTotalArr[13] = array("bettype" => 13, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[14] = array("bettype" => 14, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[18] = array("bettype" => 18, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[1] = array("bettype" => 1, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[2] = array("bettype" => 2, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[3] = array("bettype" => 3, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[20] = array("bettype" => 20, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[28] = array("bettype" => 28, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[30] = array("bettype" => 30, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[47] = array("bettype" => 47, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[49] = array("bettype" => 49, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);
$dataTotalArr[50] = array("bettype" => 50, "totalnum" => 0, "amount" => 0, "amount_rate" => 0, "back1" => 0, "back2" => 0);

$totalRs = $BetTotal_6h->getDataListTotal($lotto_id, $bettypeStr, $showid, $split, $diskStr);

while (!$totalRs->eof)
{
    $tempIdx = $totalRs->f['bettype'];
    $dataTotalArr[$tempIdx] = $totalRs->f;
    $totalRs->next();
}
$totalRs->close();

$lostwin = array();
$winlost = $dataTotalArr[$betsGame]['amount'] - $dataTotalArr[$betsGame]['back1'] + $dataTotalArr[$betsGame]['back2'];
$i = 1;
while ($i < 50)
{
    $showDataArr[$betsGame][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => $winlost,
        "namount" => ""
    );
    $lostwin[$betsGame][$i] = $winlost;
    ++$i;
}
$i = 1;
while ($i <= 3)
{
    $showDataArr[13][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => 0,
        "namount" => "",
        "srd" => 0
    );
    ++$i;
}
$i = 1;
while ($i < 13)
{
    $showDataArr[14][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => 0,
        "namount" => "",
        "srd" => 0
    );
    $showDataArr[18][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => 0,
        "namount" => ""
    );
    ++$i;
}
$showDataArr[1][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[1][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[2][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[2][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[3][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[3][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[20][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[20][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[28][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[28][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[30][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[30][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[47][1] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$showDataArr[47][2] = array(
    "numbers" => $i,
    "totalnum" => 0,
    "amount" => 0,
    "amount_rate" => 0,
    "rate" => 0,
    "back1" => 0,
    "back2" => 0,
    "winlost" => 0,
    "namount" => "",
    "srd" => 0
);
$i = 0;
while ($i <= 4)
{
    $showDataArr[49][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => 0,
        "namount" => "",
        "srd" => 0
    );
    ++$i;
}
$i = 0;
while ($i <= 9)
{
    $showDataArr[50][$i] = array(
        "numbers" => $i,
        "totalnum" => 0,
        "amount" => 0,
        "amount_rate" => 0,
        "rate" => 0,
        "back1" => 0,
        "back2" => 0,
        "winlost" => 0,
        "namount" => "",
        "srd" => 0
    );
    ++$i;
}

$sql = $BetTotal_6h->getDataListByNumSsSQL($lotto_id, $bettypeStr, $showid, $diskStr, $split, $ratemod);
$rs = getdb($sql);
$updatetime = systime() - 30;
while (!$rs->eof)
{
    $bettype = $rs->f['bettype'];
    $winlost = $dataTotalArr[$bettype]['amount'] - $rs->f['amount_rate'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$rs->f[1]]['back2'];
    $i = intval($rs->f['numbers']);
    $showDataArr[$bettype][$i]['totalnum'] = $rs->f['totalnum'];
    $showDataArr[$bettype][$i]['amount'] = $rs->f['amount'];
    $showDataArr[$bettype][$i]['amount_rate'] = $rs->f['amount_rate'];
    $showDataArr[$bettype][$i]['rate'] = $rs->f['rate'];
    $showDataArr[$bettype][$i]['back1'] = $rs->f['back1'];
    $showDataArr[$bettype][$i]['back2'] = $rs->f['back2'];
    $showDataArr[$bettype][$i]['winlost'] = $winlost;
    if ($bettype == $betsGame)
    {
        $lostwin[$bettype][$i] = $winlost;
    }
    if ($updatetime < $rs->f['updatetime'])
    {
        $showDataArr[$bettype][$i]['namount'] = " class=\"namount\"";
    }
    $rs->next();
}
$rs->close();

if ($ratemod == 0 && $bets == 2)
{
    $rs = getdb("select * from rate24{$disk_code} where lotto_id={$lotto_id}");
}
else if ($ratemod == 0)
{
    $rs = getdb("select * from rate0{$disk_code} where lotto_id={$lotto_id}");
}
if ($ratemod == 0)
{
    $user_rate0 = get_share_rate0($userid);
    if ($theacl == 255)
    {
        $i = 1;
        while ($i < 50)
        {
            if ($theacl == 255)
            {
                $user_rate0 = 0;
            }
            $showDataArr[$betsGame][$i]['rate'] = $rs->f["r" . d2($i)] - $user_rate0 - 0;
            ++$i;
        }
    }
    else
    {
        $rsu = get_srates_data($userid, $lotto_id, 0);
        $i = 1;
        while ($i < 50)
        {
            $showDataArr[$betsGame][$i]['rate'] = $rs->f["r" . d2($i)] - $rsu->f["r" . d2($i)] - $user_rate0 - 0;
            ++$i;
        }
    }
    $rs->close();
    $rs = getdb("select * from rate1{$disk_code} where lotto_id={$lotto_id}");
    if ($rs->eof)
    {
        exit("Error ID!");
    }
    if ($theacl < 6)
    {
        $rsu = get_srates_data($userid, $lotto_id, 1);
        $showDataArr[1][1]['srd'] = $rsu->f['r1_1'] - 0;
        $showDataArr[1][2]['srd'] = $rsu->f['r1_2'] - 0;
        $showDataArr[2][1]['srd'] = $rsu->f['r2_1'] - 0;
        $showDataArr[2][2]['srd'] = $rsu->f['r2_2'] - 0;
        $showDataArr[3][1]['srd'] = $rsu->f['r3_1'] - 0;
        $showDataArr[3][2]['srd'] = $rsu->f['r3_2'] - 0;
        $showDataArr[13][1]['srd'] = $rsu->f['r13_1'] - 0;
        $showDataArr[13][2]['srd'] = $rsu->f['r13_2'] - 0;
        $showDataArr[13][3]['srd'] = $rsu->f['r13_3'] - 0;
        $i = 1;
        while ($i < 13)
        {
            $showDataArr[14][$i]['srd'] = $rsu->f["r14_{$i}"];
            ++$i;
        }
        $showDataArr[20][1]['srd'] = $rsu->f['r20_1'] - 0;
        $showDataArr[20][2]['srd'] = $rsu->f['r20_2'] - 0;
        $showDataArr[28][1]['srd'] = $rsu->f['r28_1'] - 0;
        $showDataArr[28][2]['srd'] = $rsu->f['r28_2'] - 0;
        $showDataArr[30][1]['srd'] = $rsu->f['r30_1'] - 0;
        $showDataArr[30][2]['srd'] = $rsu->f['r30_2'] - 0;
        $showDataArr[46][1]['srd'] = $rsu->f['r46_1'] - 0;
        $showDataArr[46][2]['srd'] = $rsu->f['r46_2'] - 0;
        $showDataArr[46][3]['srd'] = $rsu->f['r46_3'] - 0;
        $showDataArr[47][1]['srd'] = $rsu->f['r47_1'] - 0;
        $showDataArr[47][2]['srd'] = $rsu->f['r47_2'] - 0;
        $rsu->close();
    }
    $showDataArr[1][1]['rate'] = $rs->f['r1_1'] - $showDataArr[1][1]['srd'];
    $showDataArr[1][2]['rate'] = $rs->f['r1_2'] - $showDataArr[1][2]['srd'];
    $showDataArr[2][1]['rate'] = $rs->f['r2_1'] - $showDataArr[2][1]['srd'];
    $showDataArr[2][2]['rate'] = $rs->f['r2_2'] - $showDataArr[2][2]['srd'];
    $showDataArr[3][1]['rate'] = $rs->f['r3_1'] - $showDataArr[3][1]['srd'];
    $showDataArr[3][2]['rate'] = $rs->f['r3_2'] - $showDataArr[3][2]['srd'];
    $showDataArr[13][1]['rate'] = $rs->f['r13_1'] - $showDataArr[13][1]['srd'];
    $showDataArr[13][2]['rate'] = $rs->f['r13_2'] - $showDataArr[13][2]['srd'];
    $showDataArr[13][3]['rate'] = $rs->f['r13_3'] - $showDataArr[13][3]['srd'];
    $i = 1;
    while ($i < 13)
    {
        $showDataArr[14][$i]['rate'] = $rs->f["r14_{$i}"] - $showDataArr[14][$i]['srd'];
        $showDataArr[18][$i]['rate'] = $rs->f["r18_{$i}"] - 0;
        ++$i;
    }
    $showDataArr[20][1]['rate'] = $rs->f['r20_1'] - $showDataArr[20][1]['srd'];
    $showDataArr[20][2]['rate'] = $rs->f['r20_2'] - $showDataArr[20][2]['srd'];
    $showDataArr[28][1]['rate'] = $rs->f['r28_1'] - $showDataArr[28][1]['srd'];
    $showDataArr[28][2]['rate'] = $rs->f['r28_2'] - $showDataArr[28][2]['srd'];
    $showDataArr[30][1]['rate'] = $rs->f['r30_1'] - $showDataArr[30][1]['srd'];
    $showDataArr[30][2]['rate'] = $rs->f['r30_2'] - $showDataArr[30][2]['srd'];
    $showDataArr[47][1]['rate'] = $rs->f['r47_1'] - $showDataArr[47][1]['srd'];
    $showDataArr[47][2]['rate'] = $rs->f['r47_2'] - $showDataArr[47][2]['srd'];
    $rs->close();
}

if (isset($showDataArr[$betsGame]) && intval($dataTotalArr[$betsGame]['amount']) != 0)
{
    asort($lostwin[$betsGame]);
    reset($lostwin[$betsGame]);
    $k = 1;
	
    $showDataArrTemp = array();
    foreach ($lostwin[$betsGame] as $key => $val)
    {
        $showDataArrTemp[$betsGame][$k] = $showDataArr[$betsGame][$key];
        ++$k;
    }
    $showDataArr[$betsGame] = $showDataArrTemp[$betsGame];
}

$list = "";
$bettype = $betsGame;
$j = 1;
while ($j <= 10)
{
    $i = 0;
    while ($i < 5)
    {
        if ($i == 0)
        {
            $list .= "<tr class=td12 align=right>";
        }
        $k = $i * 10 + $j;
        if (49 < $k)
        {
            $list .= "<td></td><td></td><td></td><td></td><td></td>";
        }
        else
        {
            $numer = $showDataArr[$bettype][$k]['numbers'];
            $tempIdx = $k;
            $alert = "";
            $alert = $showDataArr[$bettype][$tempIdx]['namount'];
            if ($split == 1)
            {
                if (0 < $curruser['alert2'] && $curruser['alert2'] <= $showDataArr[$bettype][$tempIdx]['amount'])
                {
                    $alert = " class=alert2";
                }
                else if (0 < $curruser['alert1'] && $curruser['alert1'] <= $showDataArr[$bettype][$tempIdx]['amount'])
                {
                    $alert = " class=alert1";
                }
                $list .= "<td class=td6 align=center><font color=" . $colors[$g_numcolor[$numer]] . "><b>" . d2($numer) . "</b></font></td>";
            }
            else
            {
                $list .= "<td class=td6 align=center><font color=" . $colors[$g_numcolor[$numer]] . "><b>" . d2($numer) . "</b></font></td>";
            }
            if (0 < $showDataArr[$bettype][$k]['totalnum'])
            {
                $list .= "<td nowrap>" . $showDataArr[$bettype][$tempIdx]['totalnum'] . "</td>";
                $list .= "<td {$alert} nowrap><a href=" . get_listurl2($open, $listbetmod, d2($numer), 0) . ">" . round($showDataArr[$bettype][$tempIdx]['amount']) . "</a></td>";
            }
            else
            {
                $list .= "<td nowrap> 0</td>";
                $list .= "<td nowrap> 0</td>";
                $showDataArr[$bettype][$tempIdx]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
            }
            $list .= "<td nowrap> " . sprintf("%.2f", $showDataArr[$bettype][$tempIdx]['rate']) . "</td>";
            if ($showDataArr[$bettype][$k]['winlost'] < 0)
            {
                $list .= "<td nowrap><font color='#EE2200'>" . round($showDataArr[$bettype][$tempIdx]['winlost']) . "</font></td>";
            }
            else
            {
                $list .= "<td nowrap><font color='#00AA22'>" . round($showDataArr[$bettype][$tempIdx]['winlost']) . "</font></td>";
            }
        }
        ++$i;
    }
    ++$j;
}

$prate_list = "<td nowrap>赔率</td>";
$tpl->set("prate_table", $prate_list);
$tpl->set("list", $list);
$tpl->set("total", round($dataTotalArr[$bettype]['amount']));
$tpl->set("sum_count", intval($dataTotalArr[$bettype]['totalnum']));
$bettype = 1;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>特单</td>";
if (0 < $showDataArr[$bettype]['1']['totalnum'])
{
    $alert = $showDataArr[$bettype]['1']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['1']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert} ><a href=" . get_listurl2($open, 1, 1, 0) . ">" . round($showDataArr[$bettype]['1']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype]['1']['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype]['1']['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['1']['rate'] . "</td>";
if ($showDataArr[$bettype]['1']['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype]['1']['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype]['1']['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>特双</td>";
if (0 < $showDataArr[$bettype]['2']['totalnum'])
{
    $alert = $showDataArr[$bettype]['2']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['2']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 1, 2, 0) . ">" . round($showDataArr[$bettype]['2']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype]['2']['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype]['2']['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['2']['rate'] . "</td>";
if ($showDataArr[$bettype]['2']['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list1", $list);
$bettype = 2;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>特大</td>";
if (0 < $showDataArr[$bettype]['1']['totalnum'])
{
    $alert = $showDataArr[$bettype]['1']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['1']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 2, 1, 0) . ">" . round($showDataArr[$bettype]['1']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['1']['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype]['1']['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype]['1']['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>特小</td>";
if (0 < $showDataArr[$bettype]['2']['totalnum'])
{
    $alert = $showDataArr[$bettype]['2']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['2']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 2, 2, 0) . ">" . round($showDataArr[$bettype]['2']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype]['2']['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype]['2']['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['2']['rate'] . "</td>";
if ($showDataArr[$bettype]['2']['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list2", $list);
$bettype = 20;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>家禽</td>";
if (0 < $showDataArr[$bettype]['1']['totalnum'])
{
    $alert = $showDataArr[$bettype]['1']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['1']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl($open, 20, 1) . ">" . round($showDataArr[$bettype]['1']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['1']['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>野兽</td>";
if (0 < $showDataArr[$bettype]['2']['totalnum'])
{
    $alert = $showDataArr[$bettype]['2']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['2']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl($open, 20, 2) . ">" . round($showDataArr[$bettype]['2']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype]['2']['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype]['2']['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['2']['rate'] . "</td>";
if ($showDataArr[$bettype]['2']['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype]['2']['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list20", $list);
$bettype = 3;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>合单</td>";
if (0 < $showDataArr[$bettype]['1']['totalnum'])
{
    $alert = $showDataArr[$bettype]['1']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['1']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 3, 1, 0) . ">" . round($showDataArr[$bettype]['1']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['1']['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>合双</td>";
if (0 < $showDataArr[$bettype]['2']['totalnum'])
{
    $alert = $showDataArr[$bettype]['2']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['2']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 3, 2, 0) . ">" . round($showDataArr[$bettype]['2']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][2]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][2]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['2']['rate'] . "</td>";
if ($showDataArr[$bettype][2]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list3", $list);
$bettype = 47;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>合大</td>";
if (0 < $showDataArr[$bettype]['1']['totalnum'])
{
    $alert = $showDataArr[$bettype]['1']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['1']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 47, 1, 0) . ">" . round($showDataArr[$bettype]['1']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['1']['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>合小</td>";
if (0 < $showDataArr[$bettype]['2']['totalnum'])
{
    $alert = $showDataArr[$bettype]['2']['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype]['2']['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 47, 2, 0) . ">" . round($showDataArr[$bettype]['2']['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][2]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][2]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype]['2']['rate'] . "</td>";
if ($showDataArr[$bettype][2]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list47", $list);
$bettype = 14;
$list = "";
$i = 1;
while ($i <= 12)
{
    if ($i % 4 == 1)
    {
        $list .= "<tr class=td2>";
    }
    $list .= "<td class=td15 align=center>" . $g_chinayear[$i] . "</td>";
    if (0 < $showDataArr[$bettype][$i]['totalnum'])
    {
        $alert = $showDataArr[$bettype][$i]['namount'];
        $list .= "<td align=right>" . $showDataArr[$bettype][$i]['totalnum'] . "</td>";
        $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 14, $i, 0) . ">" . round($showDataArr[$bettype][$i]['amount']) . "</a></td>";
    }
    else
    {
        $list .= "<td align=right> 0</td>";
        $list .= "<td align=right> 0</td>";
        if (isset($dataTotalArr[$bettype]['amount']))
        {
            $showDataArr[$bettype][$i]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
        }
        else
        {
            $showDataArr[$bettype][$i]['winlost'] = 0;
        }
    }
    $list .= "<td align=right>" . $showDataArr[$bettype][$i]['rate'] . "</td>";
    if ($showDataArr[$bettype][$i]['winlost'] < 0)
    {
        $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td>";
    }
    else
    {
        $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td>";
    }
    ++$i;
}
$tpl->set("list13", $list);
$tpl->set("list13sum", "合计：<b>" . round($dataTotalArr[$bettype]['totalnum']) . "</b> 笔，金额：<b>" . intval($dataTotalArr[$bettype]['amount']) . "</b>");
$bettype = 13;
$list = "";
$total1 = 0;
$total2 = 0;
$i = 1;
while ($i <= 3)
{
    $list .= "<tr class=td2>";
    $list .= "<td class=td15 align=center>" . $g_colorname[$i] . "</td>";
    if (0 < $showDataArr[$bettype][$i]['totalnum'])
    {
        $alert = $showDataArr[$bettype][$i]['namount'];
        $list .= "<td align=right>" . $showDataArr[$bettype][$i]['totalnum'] . "</td>";
        $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 13, $i, 0) . ">" . round($showDataArr[$bettype][$i]['amount']) . "</a></td>";
    }
    else
    {
        $list .= "<td align=right> 0</td>";
        $list .= "<td align=right> 0</td>";
        if (isset($dataTotalArr[$bettype]['amount']))
        {
            $showDataArr[$bettype][$i]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
        }
        else
        {
            $showDataArr[$bettype][$i]['winlost'] = 0;
        }
    }
    $list .= "<td align=right>" . $showDataArr[$bettype][$i]['rate'] . "</td>";
    if ($showDataArr[$bettype][$i]['winlost'] < 0)
    {
        $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    else
    {
        $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    ++$i;
}
$list .= "<tr class=td6 align=right><td class=td0>合计<td>" . intval($dataTotalArr[$bettype]['totalnum']) . "<td>" . round($dataTotalArr[$bettype]['amount']) . "<td><td></td>";
$tpl->set("list14", $list);

$bettype = 18;
$list = "";
$n = 1;
$i = 1;
while ($i <= 3)
{
    $list .= "<tr class=td2>";
    $j = 1;
    while ($j <= 4)
    {
        $list .= "<td class=td15 align=center>" . $g_colorname2[$n] . "</td>";
        if (0 < $showDataArr[$bettype][$n]['totalnum'])
        {
            $alert = $showDataArr[$bettype][$n]['namount'];
            $list .= "<td align=right>" . $showDataArr[$bettype][$n]['totalnum'] . "</td>";
            $list .= "<td align=right {$alert}><a href=" . get_listurl($open, 18, $n) . ">" . round($showDataArr[$bettype][$n]['amount']) . "</a></td>";
        }
        else
        {
            $list .= "<td align=right> 0</td>";
            $list .= "<td align=right> 0</td>";
            if (isset($dataTotalArr[$bettype]['amount']))
            {
                $showDataArr[$bettype][$n]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
            }
            else
            {
                $showDataArr[$bettype][$n]['winlost'] = 0;
            }
        }
        $list .= "<td align=right>" . $showDataArr[$bettype][$n]['rate'] . "</td>";
        if ($showDataArr[$bettype][$n]['winlost'] < 0)
        {
            $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][$n]['winlost']) . "</font></td>";
        }
        else
        {
            $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][$n]['winlost']) . "</font></td>";
        }
        ++$n;
        ++$j;
    }
    ++$i;
}
$tpl->set("list18", $list);
$tpl->set("list18sum", "合计：<b>" . intval($dataTotalArr[$bettype]['totalnum']) . "</b> 笔，金额：<b>" . round($dataTotalArr[$bettype]['amount']) . "</b>");
$bettype = 28;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>特尾大</td>";
if (0 < $showDataArr[$bettype][1]['totalnum'])
{
    $alert = $showDataArr[$bettype][1]['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype][1]['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 28, 1, 0) . ">" . round($showDataArr[$bettype][1]['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype][1]['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][1]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>特尾小</td>";
if (0 < $showDataArr[$bettype][2]['totalnum'])
{
    $alert = $showDataArr[$bettype][2]['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype][2]['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 28, 2, 0) . ">" . round($showDataArr[$bettype][2]['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][2]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][2]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype][2]['rate'] . "</td>";
if ($showDataArr[$bettype][2]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][2]['winlost']) . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list28", $list);
$bettype = 30;
$list = "<tr class=td2>";
$list .= "<td class=td15 align=center>合尾大</td>";
if (0 < $showDataArr[$bettype][1]['totalnum'])
{
    $alert = $showDataArr[$bettype][1]['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype][1]['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 30, 1, 0) . ">" . round($showDataArr[$bettype][1]['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][1]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][1]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype][1]['rate'] . "</td>";
if ($showDataArr[$bettype][1]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . $showDataArr[$bettype][1]['winlost'] . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . $showDataArr[$bettype][1]['winlost'] . "</font></td></tr>";
}
$list .= "<tr class=td2>";
$list .= "<td class=td15 align=center>合尾小</td>";
if (0 < $showDataArr[$bettype][2]['totalnum'])
{
    $alert = $showDataArr[$bettype][2]['namount'];
    $list .= "<td align=right>" . $showDataArr[$bettype][2]['totalnum'] . "</td>";
    $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 30, 2, 0) . ">" . round($showDataArr[$bettype][2]['amount']) . "</a></td>";
}
else
{
    $list .= "<td align=right> 0</td>";
    $list .= "<td align=right> 0</td>";
    if (isset($dataTotalArr[$bettype]['amount']))
    {
        $showDataArr[$bettype][2]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
    }
    else
    {
        $showDataArr[$bettype][2]['winlost'] = 0;
    }
}
$list .= "<td align=right>" . $showDataArr[$bettype][2]['rate'] . "</td>";
if ($showDataArr[$bettype][2]['winlost'] < 0)
{
    $list .= "<td align=right><font color='#EE2200'>" . $showDataArr[$bettype][2]['winlost'] . "</font></td></tr>";
}
else
{
    $list .= "<td align=right><font color='#00AA22'>" . $showDataArr[$bettype][2]['winlost'] . "</font></td></tr>";
}
$list .= "<tr class=td6>";
$list .= "<td class=td0 align=right>合计</td>";
$list .= "<td align=right>" . intval($dataTotalArr[$bettype]['totalnum']) . "</td>";
$list .= "<td align=right>" . round($dataTotalArr[$bettype]['amount']) . "</td><td></td><td></td></tr>";
$tpl->set("list30", $list);
$bettype = 49;
$list = "";
$total1 = 0;
$total2 = 0;
$i = 0;
while ($i <= 4)
{
    $list .= "<tr class=td2>";
    $list .= "<td class=td15 align=center>头".$i."</td>";
    if (0 < $showDataArr[$bettype][$i]['totalnum'])
    {
        $alert = $showDataArr[$bettype][$i]['namount'];
        $list .= "<td align=right>" . $showDataArr[$bettype][$i]['totalnum'] . "</td>";
        $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 49, $i, 0) . ">" . round($showDataArr[$bettype][$i]['amount']) . "</a></td>";
    }
    else
    {
        $list .= "<td align=right> 0</td>";
        $list .= "<td align=right> 0</td>";
        if (isset($dataTotalArr[$bettype]['amount']))
        {
            $showDataArr[$bettype][$i]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
        }
        else
        {
            $showDataArr[$bettype][$i]['winlost'] = 0;
        }
    }
    $list .= "<td align=right>" . $showDataArr[$bettype][$i]['rate'] . "</td>";
    if ($showDataArr[$bettype][$i]['winlost'] < 0)
    {
        $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    else
    {
        $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    ++$i;
}
$list .= "<tr class=td6 align=right><td class=td0>合计<td>" . intval($dataTotalArr[$bettype]['totalnum']) . "<td>" . round($dataTotalArr[$bettype]['amount']) . "<td><td></td>";
$tpl->set("list49", $list);
$bettype = 50;
$list = "";
$total1 = 0;
$total2 = 0;
$i = 0;

while ($i <= 9)
{
    $list .= "<tr class=td2>";
    $list .= "<td class=td15 align=center>尾".$i."</td>";
    if (0 < $showDataArr[$bettype][$i]['totalnum'])
    {
        $alert = $showDataArr[$bettype][$i]['namount'];
        $list .= "<td align=right>" . $showDataArr[$bettype][$i]['totalnum'] . "</td>";
        $list .= "<td align=right {$alert}><a href=" . get_listurl2($open, 50, $i, 0) . ">" . round($showDataArr[$bettype][$i]['amount']) . "</a></td>";
    }
    else
    {
        $list .= "<td align=right> 0</td>";
        $list .= "<td align=right> 0</td>";
        if (isset($dataTotalArr[$bettype]['amount']))
        {
            $showDataArr[$bettype][$i]['winlost'] = $dataTotalArr[$bettype]['amount'] - $dataTotalArr[$bettype]['back1'] + $dataTotalArr[$bettype]['back2'];
        }
        else
        {
            $showDataArr[$bettype][$i]['winlost'] = 0;
        }
    }
    $list .= "<td align=right>" . $showDataArr[$bettype][$i]['rate'] . "</td>";
    if ($showDataArr[$bettype][$i]['winlost'] < 0)
    {
        $list .= "<td align=right><font color='#EE2200'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    else
    {
        $list .= "<td align=right><font color='#00AA22'>" . round($showDataArr[$bettype][$i]['winlost']) . "</font></td></tr>";
    }
    ++$i;
}
$list .= "<tr class=td6 align=right><td class=td0>合计<td>" . intval($dataTotalArr[$bettype]['totalnum']) . "<td>" . round($dataTotalArr[$bettype]['amount']) . "<td><td></td>";
$tpl->set("list50", $list);
$tpl->load("main", "onlinebet.htm");
$tpl->show("main");
$ui->footer();
?>